package com.github.thinwonton.quartz.misfire;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 重启调度器
 */
public class JDBCStoreRebootTest {
    private static final Logger logger = LoggerFactory.getLogger(JDBCStoreRebootTest.class);

    public static void main(String[] args) throws SchedulerException, InterruptedException {
        StdSchedulerFactory schedulerFactory = new StdSchedulerFactory();
        schedulerFactory.initialize("quartz.properties"); //加载配置文件
        Scheduler scheduler = schedulerFactory.getScheduler();

        logger.info("Scheduler Name:" + scheduler.getSchedulerName());

        // 调度器开始工作
        scheduler.start();

        Thread.sleep(2 * 60 * 1000);

        logger.info("关闭调度器ing...");
        scheduler.shutdown();

    }
}
